import React, { Fragment } from 'react';
import Link from 'umi/link';
import { Icon } from 'antd';
import GlobalFooter from '@/components/GlobalFooter';
import DocumentTitle from 'react-document-title';
import { getSiteTitle, getSiteLogo }  from '../utils/request';
import styles from './UserLayout.less';


const links = [
  {
    key: 'help',
    title: '帮助',
    href: '',
  },
  {
    key: 'privacy',
    title: '隐私',
    href: '',
  },
  {
    key: 'terms',
    title: '条款',
    href: '',
  },
];

const copyright = (
  <Fragment>
    <span style={{color:'rgba(255,255,255,.7)'}}>Copyright <Icon type="copyright" /> 2018 dolay.</span>
  </Fragment>
);

class UserLayout extends React.PureComponent {



  getPageTitle () {
    let title = getSiteTitle();
    return title;
  }

  render() {
    const { children } = this.props;
    return (
      <DocumentTitle title={this.getPageTitle()}>
        <div className={styles.container}>
          <div className={styles.content}>
            <div className={styles.top}>
              <div className={styles.header}>
                <Link to="/">
                  <img alt="logo" className={styles.logo} src={getSiteLogo()} />
                  <span className={styles.title}>{this.getPageTitle()}</span>
                </Link>
              </div>
              <div className={styles.desc}></div>
            </div>
            {children}
          </div>
          <GlobalFooter copyright={copyright} />
        </div>
      </DocumentTitle>
    );
  }
}

export default UserLayout;
